<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateShopFreightTable extends Migration
{
    //运费规则
    public function up()
    {
        Schema::create('shop_freight_template', function (Blueprint $table) {
            $table->Increments('id');
            $table->string('template_name')->comment('模板名称');
            $table->decimal('first_price',10,2)->default(0)->comment('首价格    默认0');
            $table->smallInteger('first_count')->default(1)->comment('首包含 件/公斤   默认1');

            $table->decimal('add_price',10,2)->default(0)->comment('新增价格 默认0');
            $table->integer('add_count')->default(0)->comment('新增计数 默认0');

            $table->boolean('unit_type')->default(0)->comment('计算单位  件=0 Kg=1   默认件');
            $table->boolean('is_free')->default(false)->comment(' 是否包邮 默认不包邮');

            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('shop_freight');
    }
}
